<template>
  <view class="page-bg">
    <view class="main-container">
      <view class="page">
		   <view class="modle">投诉类型</view>
		  <input placeholder="请输入你的投诉类型" v-model="sendDate.title"/>
        <view class="feedback-title">
          <view class="tl-font-32-29">投诉建议内容</view>
        </view>
        <view class="feedback-body">
          <textarea placeholder="写下你的投诉/建议吧..." v-model="sendDate.content" maxlength="300" class="feedback-textare"></textarea>
  
        </view>
          </view>
        </view>
        <button class="feedback-submit"  :class="!disabled ? 'active': 'tl-btn-red'"   @click="submit()">提交</button>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
	disabled:false,
	Token:{
		"token":'',
	},
    sendDate: {
        "complaint_id": '',
        "orderId": '',
		"sellerId":'',
		"sellerName":'',
		"sellerTele":'',
		"homestayId":'',
		"title":'',
		"content":'',
		"pictures":'',
		"userid":'',
		"dealer_name":'', 
		"complaintTime":'',
		"status":'',
		"dealerId":'',
		"dealTime;":'',
		"dealerName":'',
		
      }
    }
  },

    onLoad: function (options) {
	    let receivedObject = JSON.parse(options.OrderMsg);         
		this.sendDate.orderId=receivedObject.id;
		this.sendDate.homestayId=receivedObject.homestayid;
		this.sendDate.pictures=receivedObject.picture;
		this.sendDate.userid=receivedObject.userid;
        this.Token.token=uni.getStorageSync('login-user').token;
	  },
	
  

  methods: {

 
	
	submit(){
		uni.request({
			url:"http://192.168.2.218:8086/business/user/complaint/add",
			method:'POST',
			header:{
				'token':this.Token.token
			},
			data:this.sendDate,
			success: (res) => {
				if(res.data.code==1)
				uni.showToast({
					icon:'success',
					title:'投诉成功',
					duration:2000,
				})
				else
				uni.showToast({
					icon:'fail',
					title:'失败',
					duration:2000,
				})
			},
			fail: () => {
				
			}
		})
	}
  }
}
</script>

<style>
.page-bg {
  width: 100vw;
  height: auto;
  overflow: hidden;
  background-size: 750rpx auto;
  background-color: #fff;
}

.main-container {
  width: 686rpx;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.tl-font-32-29{
  font-size: 32rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #292929;
}
.modle{
	margin-left: 5px;
  font-size: 32rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #292929;
}

/*问题反馈*/
.feedback-title {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx;
  color: #8f8f94;
  font-size: 28rpx;
}
.feedback-star-view.feedback-title {
  justify-content: flex-start;
  margin: 0;
}
.feedback-quick {
  position: relative;
  padding-right: 40rpx;
}
.feedback-quick:after {
  font-family: uniicons;
  font-size: 40rpx;
  content: '\e581';
  position: absolute;
  right: 0;
  top: 50%;
  color: #bbb;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}
.feedback-body {
  position: relative;
  background: #fff;
}
.tl-p-right{
  position: absolute;
  right: 20rpx;
  bottom: 20rpx;
}
.feedback-textare {
 /* height: 200rpx;
  font-size: 34rpx;
  line-height: 50rpx;
  width: 100%;
  box-sizing: border-box;
  padding: 20rpx 30rpx 0;*/
  width: 686rpx;
  height: 374rpx;
  border-radius: 8rpx;
  border: 2rpx solid #DCDCDC;
}
.feedback-input {
  font-size: 34rpx;
  height: 50rpx;
  min-height: 50rpx;
  padding: 15rpx 20rpx;
  line-height: 50rpx;
  border-bottom: 2rpx solid #DCDCDC;
}
.feedback-uploader {
  padding: 22rpx 20rpx;
}
.feedback-star {
  font-family: uniicons;
  font-size: 40rpx;
  margin-left: 6rpx;
}
.feedback-star-view {
  margin-left: 20rpx;
}
.feedback-star:after {
  content: '\e408';
}
.feedback-star.active {
  color: #FFB400;
}
.feedback-star.active:after {
  content: '\e438';
}
.feedback-submit {
 /* background: #007AFF;
  color: #FFFFFF;*/
  margin: 108rpx 20rpx 20rpx 20rpx;
}
.tl-btn-red{
 /* width: 500rpx;*/
  height: 72rpx;
  line-height: 72rpx;
  background: #E7E7E7;
  border-radius: 44rpx;
  font-size: 24rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #565656;
  border:0 2rpx solid #E7E7E7;
}
.active{
  background: #E04646;
  color: #fff;
  border: 0;

}
</style>